#pragma once
#include "particle.hh"
#include <glm/vec3.hpp>
#include <deque>

namespace gl
{
	struct particle_system
	{
		using value_type = particle;
		using value_list = std::deque<value_type>;

		particle_system(glm::vec3 const& rnd)
			: randomness{rnd} {}

		void add(int life,
				glm::vec3 const& pos,
				glm::vec3 const& v,
				glm::vec3 const& a,
				glm::vec3 const& color={0.1, 0.1, 0.1});
		void update(float step);
		void render(bool spark=true) const;

	private:
		glm::vec3 randomness;
		value_list particles;
	};
}

